package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.ProDiscountEntity;
import com.dragon.modules.yuegou.enums.member.ProDiscountRoundingMode;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商品折扣表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2022-03-09 19:03:27
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class ProDiscountQuery extends ProDiscountEntity implements Query<ProDiscountEntity> {

    /** 商品折扣ID查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈id查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 权益名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 权益内容查询条件 */
	@JsonUnwrapped(prefix = "content")
	private Condition<String> contentCondition;

    /** 折扣比率查询条件 */
	@JsonUnwrapped(prefix = "rate")
	private Condition<BigDecimal> rateCondition;

    /** 平台分摊查询条件 */
	@JsonUnwrapped(prefix = "platformRate")
	private Condition<BigDecimal> platformRateCondition;

    /** 商户分摊查询条件 */
	@JsonUnwrapped(prefix = "merchantRate")
	private Condition<BigDecimal> merchantRateCondition;

    /** 启用状态（1：启用 0：禁用）查询条件 */
	@JsonUnwrapped(prefix = "enableStatus")
	private Condition<Boolean> enableStatusCondition;

    /** 保留小数查询条件 */
	@JsonUnwrapped(prefix = "accuracy")
	private Condition<Integer> accuracyCondition;

    /** [枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件 */
	@JsonUnwrapped(prefix = "roundingMode")
	private Condition<ProDiscountRoundingMode> roundingModeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 删除 0-未删除；1-已删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public ProDiscountQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public ProDiscountQuery(ProDiscountEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public ProDiscountQuery(ProDiscountQuery other) {
		super(other);
		if (other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if (other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if (other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if (other.contentCondition != null) {
			this.contentCondition = other.contentCondition.copy();
		}
		if (other.rateCondition != null) {
			this.rateCondition = other.rateCondition.copy();
		}
		if (other.platformRateCondition != null) {
			this.platformRateCondition = other.platformRateCondition.copy();
		}
		if (other.merchantRateCondition != null) {
			this.merchantRateCondition = other.merchantRateCondition.copy();
		}
		if (other.enableStatusCondition != null) {
			this.enableStatusCondition = other.enableStatusCondition.copy();
		}
		if (other.accuracyCondition != null) {
			this.accuracyCondition = other.accuracyCondition.copy();
		}
		if (other.roundingModeCondition != null) {
			this.roundingModeCondition = other.roundingModeCondition.copy();
		}
		if (other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if (other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if (other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		this.setOther(other);
	}

	private void setOther(ProDiscountQuery other){
		if(other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
	}

	@Override
	public QueryWrapper<ProDiscountEntity> toQueryWrapper() {
		QueryWrapper<ProDiscountEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (contentCondition != null) {
			contentCondition.toWrapper(wrapper, COL_CONTENT);
		}
		if (rateCondition != null) {
			rateCondition.toWrapper(wrapper, COL_RATE);
		}
		if (platformRateCondition != null) {
			platformRateCondition.toWrapper(wrapper, COL_PLATFORM_RATE);
		}
		if (merchantRateCondition != null) {
			merchantRateCondition.toWrapper(wrapper, COL_MERCHANT_RATE);
		}
		if (enableStatusCondition != null) {
			enableStatusCondition.toWrapper(wrapper, COL_ENABLE_STATUS);
		}
		if (accuracyCondition != null) {
			accuracyCondition.toWrapper(wrapper, COL_ACCURACY);
		}
		if (roundingModeCondition != null) {
			roundingModeCondition.toWrapper(wrapper, COL_ROUNDING_MODE);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		return this.getQueryWrapper(wrapper);
	}

	private QueryWrapper<ProDiscountEntity> getQueryWrapper(QueryWrapper<ProDiscountEntity> wrapper){
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回商品折扣ID查询条件
	 * 
	 * @return idCondition 商品折扣ID查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取商品折扣ID查询条件
	 * 
	 * @return idCondition 商品折扣ID查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置商品折扣ID查询条件
	 * 
	 * @param idCondition 商品折扣ID查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈id查询条件
	 * 
	 * @return busdIdCondition 商圈id查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈id查询条件
	 * 
	 * @return busdIdCondition 商圈id查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈id查询条件
	 * 
	 * @param busdIdCondition 商圈id查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回权益名称查询条件
	 * 
	 * @return nameCondition 权益名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取权益名称查询条件
	 * 
	 * @return nameCondition 权益名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置权益名称查询条件
	 * 
	 * @param nameCondition 权益名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回权益内容查询条件
	 * 
	 * @return contentCondition 权益内容查询条件
	 */
	public Condition<String> content() {
		this.contentCondition = new Condition<>();
		return this.contentCondition;
	}
	
	/**
	 * 获取权益内容查询条件
	 * 
	 * @return contentCondition 权益内容查询条件
	 */
	public Condition<String> getContentCondition() {
		return contentCondition;
	}

	/**
	 * 设置权益内容查询条件
	 * 
	 * @param contentCondition 权益内容查询条件
	 */
	public void setContentCondition(Condition<String> contentCondition) {
		this.contentCondition = contentCondition;
	}

	/**
	 * 构造并返回折扣比率查询条件
	 * 
	 * @return rateCondition 折扣比率查询条件
	 */
	public Condition<BigDecimal> rate() {
		this.rateCondition = new Condition<>();
		return this.rateCondition;
	}
	
	/**
	 * 获取折扣比率查询条件
	 * 
	 * @return rateCondition 折扣比率查询条件
	 */
	public Condition<BigDecimal> getRateCondition() {
		return rateCondition;
	}

	/**
	 * 设置折扣比率查询条件
	 * 
	 * @param rateCondition 折扣比率查询条件
	 */
	public void setRateCondition(Condition<BigDecimal> rateCondition) {
		this.rateCondition = rateCondition;
	}

	/**
	 * 构造并返回平台分摊查询条件
	 * 
	 * @return platformRateCondition 平台分摊查询条件
	 */
	public Condition<BigDecimal> platformRate() {
		this.platformRateCondition = new Condition<>();
		return this.platformRateCondition;
	}
	
	/**
	 * 获取平台分摊查询条件
	 * 
	 * @return platformRateCondition 平台分摊查询条件
	 */
	public Condition<BigDecimal> getPlatformRateCondition() {
		return platformRateCondition;
	}

	/**
	 * 设置平台分摊查询条件
	 * 
	 * @param platformRateCondition 平台分摊查询条件
	 */
	public void setPlatformRateCondition(Condition<BigDecimal> platformRateCondition) {
		this.platformRateCondition = platformRateCondition;
	}

	/**
	 * 构造并返回商户分摊查询条件
	 * 
	 * @return merchantRateCondition 商户分摊查询条件
	 */
	public Condition<BigDecimal> merchantRate() {
		this.merchantRateCondition = new Condition<>();
		return this.merchantRateCondition;
	}
	
	/**
	 * 获取商户分摊查询条件
	 * 
	 * @return merchantRateCondition 商户分摊查询条件
	 */
	public Condition<BigDecimal> getMerchantRateCondition() {
		return merchantRateCondition;
	}

	/**
	 * 设置商户分摊查询条件
	 * 
	 * @param merchantRateCondition 商户分摊查询条件
	 */
	public void setMerchantRateCondition(Condition<BigDecimal> merchantRateCondition) {
		this.merchantRateCondition = merchantRateCondition;
	}

	/**
	 * 构造并返回启用状态（1：启用 0：禁用）查询条件
	 * 
	 * @return enableStatusCondition 启用状态（1：启用 0：禁用）查询条件
	 */
	public Condition<Boolean> enableStatus() {
		this.enableStatusCondition = new Condition<>();
		return this.enableStatusCondition;
	}
	
	/**
	 * 获取启用状态（1：启用 0：禁用）查询条件
	 * 
	 * @return enableStatusCondition 启用状态（1：启用 0：禁用）查询条件
	 */
	public Condition<Boolean> getEnableStatusCondition() {
		return enableStatusCondition;
	}

	/**
	 * 设置启用状态（1：启用 0：禁用）查询条件
	 * 
	 * @param enableStatusCondition 启用状态（1：启用 0：禁用）查询条件
	 */
	public void setEnableStatusCondition(Condition<Boolean> enableStatusCondition) {
		this.enableStatusCondition = enableStatusCondition;
	}

	/**
	 * 构造并返回保留小数查询条件
	 * 
	 * @return accuracyCondition 保留小数查询条件
	 */
	public Condition<Integer> accuracy() {
		this.accuracyCondition = new Condition<>();
		return this.accuracyCondition;
	}
	
	/**
	 * 获取保留小数查询条件
	 * 
	 * @return accuracyCondition 保留小数查询条件
	 */
	public Condition<Integer> getAccuracyCondition() {
		return accuracyCondition;
	}

	/**
	 * 设置保留小数查询条件
	 * 
	 * @param accuracyCondition 保留小数查询条件
	 */
	public void setAccuracyCondition(Condition<Integer> accuracyCondition) {
		this.accuracyCondition = accuracyCondition;
	}

	/**
	 * 构造并返回[枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 * 
	 * @return roundingModeCondition [枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 */
	public Condition<ProDiscountRoundingMode> roundingMode() {
		this.roundingModeCondition = new Condition<>();
		return this.roundingModeCondition;
	}
	
	/**
	 * 获取[枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 * 
	 * @return roundingModeCondition [枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 */
	public Condition<ProDiscountRoundingMode> getRoundingModeCondition() {
		return roundingModeCondition;
	}

	/**
	 * 设置[枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 * 
	 * @param roundingModeCondition [枚举]取整方式：0-向上取整-UP、1-向下取整-DOWN、2-四舍五入-HALF_UP查询条件
	 */
	public void setRoundingModeCondition(Condition<ProDiscountRoundingMode> roundingModeCondition) {
		this.roundingModeCondition = roundingModeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedTimeCondition 查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedByCondition 查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回删除 0-未删除；1-已删除查询条件
	 * 
	 * @return delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取删除 0-未删除；1-已删除查询条件
	 * 
	 * @return delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置删除 0-未删除；1-已删除查询条件
	 * 
	 * @param delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delTimeCondition 查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delByCondition 查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

}
